﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;

namespace Miao.ArchotechFix
{

    public class HediffComp_PsychicRegeneration : HediffComp
    {
        private int ticks = 0;
        private const float psychicRegeneration = 0.00125f;

        public override void CompPostTick(ref float severityAdjustment)
        {
            base.CompPostTick(ref severityAdjustment);

            if (ticks >= 60)
            {
                ticks = 0;
                Pawn.psychicEntropy.OffsetPsyfocusDirectly(psychicRegeneration);
            }
            ticks++;
        }
        public static double PsyfocusRegInPercentPerHour => Math.Round(psychicRegeneration * 100 * 40f, 2);

        public override string CompTipStringExtra => $"\n精神力: {PsyfocusRegInPercentPerHour}/小时";
        public override void CompExposeData()
        {
            base.CompExposeData();
            Scribe_Values.Look(ref ticks, "ticks", 0);
        }
    }


}
